import {defineStore} from 'pinia'
import {
    requestChainDisable,
    requestChainEnable,
    requestChainGetAll,
    ChainInfo
} from '../service/chain'
import {reactive} from 'vue'

export default defineStore('useChainStore', () => {
    // 获取二维码列表
    const chainGetAll = async (chainInfo: Partial<ChainInfo>) => {
        const res = await requestChainGetAll(chainInfo)
        return res?.data
    }
    // 修改店铺二维码状态为禁用
    const chainDisable = async (id: number) => {
        const res = await requestChainDisable(id)
        return res?.data
    }
    // 修改店铺二维码状态为启用
    const chainEnable = async (id: number) => {
        const res = await requestChainEnable(id)
        return res?.data
    }


    return {
        chainGetAll,
        chainDisable,
        chainEnable
    }
})